<template>
  <el-table :data="tableData" style="width: 100%" width="180">
    <el-table-column type="index" :index="indexMethod"></el-table-column>
    <el-table-column prop="authName" label="名称"></el-table-column>
    <el-table-column prop="path" label="路径" width="180"></el-table-column>
    <el-table-column label="等级">
      <template slot-scope="scope">
        <span v-if="scope.row.level==0">Lv.1</span>
        <span v-else-if="scope.row.level==1">Lv.2</span>
        <span v-else-if="scope.row.level==2">Lv.3</span>
      </template>
    </el-table-column>
  </el-table>
</template>

<script>
/* eslint-disable */
export default {
  data() {
    return {
      tableData: []
    };
  },
  methods: {
    async getRightsData() {
      let res = await this.$axios.get("rights/list");
      console.log(res);
      this.tableData = res.data.data;
    },
    indexMethod(index) {
      // console.log(index);
      return index;
    }
  },
  created() {
    this.getRightsData();
  }
};
</script>

<style>
</style>
